<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增抄表信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-meterReading-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">表类型：</label>
                <div class="col-sm-8">
                    <select name="meterType" class="form-control m-b" th:with="type=${@dict.getType('meter_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required" >表对象名称：</label>
                <div class="col-sm-8">
                    <input name="meterName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label" data-th-readonly="priorDegrees">上期度数：</label>
                <div class="col-sm-8">
                    <input name="priorDegrees" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">本期度数：</label>
                <div class="col-sm-8">
                    <input name="curDegrees" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" >上期抄表时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date" >
                        <input name="priorTime" class="form-control"  placeholder="yyyy-MM-dd" type="text" disabled>
                        <span class="input-group-addon" ><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required" >本期抄表时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="curTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">表状态：</label>
                <div class="col-sm-8">
                    <select name="meterStatus" class="form-control m-b" th:with="type=${@dict.getType('sys_normal_disable')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "property/meterReading"
        $("#form-meterReading-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-meterReading-add').serialize());
            }
        }

        $("input[name='priorTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='curTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>